package org.dja.nzw.discovery;

import org.dja.nzw.discovery.domain.InstanceDetails;

import java.util.List;

/**
 * Created by shuyun on 2016/7/18.
 */
public interface DiscoveryClient {
    /**
     * 启动客户端
     * @throws InterruptedException
     */
    public void startup() throws InterruptedException;

    /**
     * 关闭客户端
     * @throws InterruptedException
     */
    public void shutdown() throws InterruptedException;

    /**
     * 获取应用实例
     * @param appName
     * @return
     */
    public List<InstanceDetails> applications(String appName);

    /**
     * 获取应用实例
     * @param appName
     * @param version
     * @return
     */
    public List<InstanceDetails> applications(String appName, long version);

    /**
     * 注册应用实例
     * @param instance
     */
    public void registerService(InstanceDetails instance);

    /**
     * 注销应用实例
     * @param instance
     */
    public void updateRegisterService(InstanceDetails instance);

    /**
     * 更新应用实例状态
     * @param instance
     */
    public void unregisterService(InstanceDetails instance);
}
